package com.zwy.booksystem.controller;

import com.zwy.booksystem.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.HttpMediaTypeException;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.PrimitiveIterator;

@Controller
public class UserController {
    @RequestMapping("login")
    public String login(User user, HttpSession session){
        if (user.getUname()!=null){
            session.setAttribute("userInfo",user);
        }
        return "bookSystem";
    }

    @RequestMapping(value = {"/","index"})
    public String index(){
        return "index";
    }

}
